/**
 * 
 */
package com.intel.sam.automation.core.base;

import java.io.IOException;

import com.sip.comserver.communication.CommunicationMessage;

/**
 * @author Dhanushka Ariyasingha.
 */
public class ScenarionBase extends CommonBase {

    public Object submit(final String apiId, final String inputJson) throws ClassNotFoundException, IOException {

        final StringBuilder sb = new StringBuilder();
        sb.append("API_ID:" + apiId);

        final CommunicationMessage returnedMessage = commit(inputJson, sb.toString());

        return returnedMessage.getObject();
    }

    public Object submit(final String apiId, final String inputJson, final String resourceWithPathParam)
            throws ClassNotFoundException, IOException {

        final StringBuilder sb = new StringBuilder();
        sb.append("API_ID:" + apiId);
        sb.append("|");
        sb.append("PATH_PARAM:" + resourceWithPathParam);

        final CommunicationMessage returnedMessage = commit(inputJson, sb.toString());

        return returnedMessage.getObject();
    }

}
